home *** CD-ROM | disk | FTP | other *** search
/ CD Ware Multimedia 1994 November / Cd Ware (Nro. 2) - Epimundo.iso / OS2 / PC2_170.ZIP / SOURCE.ZIP / Source / PC2.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-01  |  32.6 KB  |  581 lines

  1. /***********************************************************************\
  2.  *                                PC2.c                                *
  3.  *              Copyright (C) by Stangl Roman, 1993, 1994              *
  4.  * This Code may be freely distributed, provided the Copyright isn't   *
  5.  * removed, under the conditions indicated in the documentation.       *
  6.  *                                                                     *
  7.  * PC2.h        Program Commander/2 header file.                       *
  8.  *                                                                     *
  9. \***********************************************************************/
  10.  
  11. #ifndef IPFC                            /* Don't include if we compile HLP files */
  12. #define         INCL_WIN                /* Environment include files */
  13. #define         INCL_GPI
  14. #define         INCL_DOS
  15. #define         INCL_DOSERRORS
  16. #define         INCL_DOSPROCESS
  17. #include        <os2.h>
  18.  
  19. #include        <stdio.h>               /* C Set/2 include files */
  20. #include        <stdlib.h>
  21. #include        <string.h>
  22. #include        <ctype.h>
  23. #include        <memory.h>
  24. #endif
  25.  
  26.                                         /* PC/2 semaphore to avoid loading PC/2 twice */
  27. #define         PC2_SEM "\\SEM32\\PC2_SEM.SEM"
  28. #define         DESKTOP_CLASS   "#37"   /* Class name of the "Desktop" window handle (which
  29.                                            is reserved in the Toolkit) but it's a container */
  30.  
  31.                                         /* WIN-OS2 3.1 settings defined only in 2.1 toolkit */
  32. #define         PROG_31_STDSEAMLESSVDM      15
  33. #define         PROG_31_STDSEAMLESSCOMMON   16
  34. #define         PROG_31_ENHSEAMLESSVDM      17
  35. #define         PROG_31_ENHSEAMLESSCOMMON   18
  36. #define         PROG_31_ENH                 19
  37. #define         PROG_31_STD                 20
  38.                                         /* Define an additional session type of WPS object
  39.                                            representing any object */
  40. #define         SSF_TYPE_WPSOBJECT          21
  41. #define         FAPPTYP_WINDOWSPROT31       0x1000
  42.                                         /* Number of KEYDATA hotkeys defined for PC/2 */
  43. #define         KEYDATACOUNT                72
  44.  
  45. #define         CLASSNAMESIZE               7
  46. #define         SWP_MOVEWINDOWVISIBLE       0x20000000
  47. #define         SWP_NOMOVE                  0x40000000
  48. #define         SWP_MOVEWINDOW              0x80000000
  49.  
  50. /*--------------------------------------------------------------------------------------*\
  51.  *                                                                                      *
  52.  * +-----+-----+-----+                                                                  *
  53.  * | www |    www========== Some windows, only two seen by the user on the display.     *
  54.  * | www |     |     |                                                                  *
  55.  * +-----+-----www---+===== Virtual Desktop (9fold-size of physical Desktop).           *
  56.  * |     | www wwww  |                                                                  *
  57.  * |  +----www | ww  |                                                                  *
  58.  * +--|ww  www-+-----+                                                                  *
  59.  * |  |ww   |============== Physical Desktop somewhere within virtual Desktop. The      *
  60.  * |  +-----+  |     |      physical Desktop is the part of the virtual Desktop which   *
  61.  * +-----+-----+-----+      the user visually can see, therefor large parts of the      *
  62.  *                          virtual Desktop can't be ssen by the user. He must use      *
  63.  * his pointing device, the slide the physical Desktop around the virtual Desktop, by   *
  64.  * moving the pointer over the surrounding rows and columns of the physical screen.     *
  65.  *                                                                                      *
  66. \*------------------------------------------------------------------------------------- */
  67.                                         /* Status bits defined for bitmapped ulMoveFlag */
  68. #define         MOVEXR          0x1     /* Set if we move all windows right (our physical
  69.                                            Desktop will move left on the virtual Desktop) */
  70. #define         MOVEXL          0x2     /* Set if we move all windows left */
  71. #define         MOVEYU          0x4     /* Set if we move all windows up (our physical
  72.                                            Desktop will move down on the virtual Desktop */
  73. #define         MOVEYD          0x8     /* Set if we move all windows down */
  74. #define         MOVED4CLICK     0x10    /* Set if we are to move all windows, but the
  75.                                            CLICK2MOVE flag is set, and therefor we require
  76.                                            a click before we really move */
  77.                                         /* Status bits defined for bitmapped ulStatusFlag */
  78. #define         SLIDINGFOCUS    0x01    /* Set if the user requested a sliding focus */
  79. #define         VIRTUALDESKTOP  0x02    /* Set if the user requested a virtual Desktop */
  80. #define         MOVEDESKTOP     0x04    /* Set if the user also wants the WPS to move */
  81. #define         CLICK2MOVE      0x08    /* Set if the user wants to click before Desktop
  82.                                            moves */
  83. #define         OVERVIEW        0x10    /* Set if the user wants an overview window */
  84. #define         PRESERVEZORDER  0x20    /* Set if sliding focus should preserve the Z-order of
  85.                                            the windows */
  86. #define         BUTTON2ZORDER   0x40    /* Set if mouse button 2 click downs on titlebars should
  87.                                            set the window to the bottom of all windows */
  88. #define         KEEPONTOP       0x80    /* Set if overview window should be the topmost window,
  89.                                            even when another window has the focus */
  90.  
  91. #define         VISIBLE         0x01    /* Set if window visible on overview window */
  92. #define         FRAMECLASS      0X02    /* Set if window has a known frame class */
  93.  
  94. #define         EF_SIZE255      255
  95.  
  96. typedef struct  _SESSIONDATA            SESSIONDATA;
  97. typedef struct  _MENUDATA               MENUDATA;
  98. typedef struct  _COMMANDLINEPARAMS      COMMANDLINEPARAMS;
  99. typedef struct  _HOOKPARAMETERS         HOOKPARAMETERS;
  100. typedef struct  _NBPAGE                 NBPAGE;
  101. typedef struct  _KEYDATA                KEYDATA;
  102. typedef struct  _WINDOWDATA             WINDOWDATA;
  103. typedef struct  _WINDOWS                WINDOWS;
  104.  
  105. #define         ENTRYSUBMENU    0       /* Popup-Menu entry is a (sub)menu */
  106. #define         ENTRYMENUITEM   1       /* Popup-Menu entry is a programm */
  107. #define         ENTRYCONTROL    2       /* Popup-Menu entry is a PC/2 configuration control */
  108. #define         ENTRYEMPTY      3       /* Popup-Menu entry is empty */
  109.  
  110. #define         CTRL_CONFIGMENU         "Config Menu"
  111. #define         CTRL_CONFIGDESKTOP      "Config Desktop"
  112. #define         CTRL_ABOUT              "About PC/2"
  113. #define         CTRL_SHUTDOWN           "ShutDown OS/2"
  114. #define         CTRL_HELP               "Help\tF1"
  115. #define         CTRL_EXIT               "Exit\tF3"
  116. #define         CTRL_BREAKSEPARATOR     "-- Vert. Break --"
  117. #define         CTRL_SEPARATOR          "--- Separator ---"
  118.  
  119. #define         PAGE_1          0       /* Index of 1st notebook page */
  120. #define         PAGE_2          1
  121. #define         PAGE_3          2
  122. #define         PAGE_4          3
  123. #define         PAGE_5          4
  124.  
  125. struct  _KEYDATA                        /* Structure that defined 1 hotkey */
  126. {
  127. USHORT          usFlags;                /* Keyboard control codes: KC_CTRL, KC_ALT,... */
  128. USHORT          usCh;                   /* Keyboard character value: 0, 1,... */
  129. BOOL            bUsed;                  /* True if this hotkey is defined */
  130. MENUDATA        *pMenuData;             /* Pointer to MenuData structure where is Hotkey
  131.                                            is defined */
  132. };
  133.  
  134. struct _SESSIONDATA                     /* Control structure to start a new session */
  135. {
  136. ULONG           id;                     /* Session ID for menu ressources */
  137. UCHAR           PgmTitle[MAXNAMEL+1];   /* Session title */
  138.                                         /* Session (sub)title on window's titlebar */
  139. UCHAR           WindowTitle[MAXNAMEL+1];
  140. UCHAR           PgmName[EF_SIZE255+1];  /* Session path and filename */
  141.                                         /* Session working directory */
  142. UCHAR           PgmDirectory[EF_SIZE255+1];
  143.                                         /* Session parameter */
  144. UCHAR           PgmInputs[EF_SIZE255+1];
  145. UCHAR           PgmDosSettings[2049];   /* DOS Settings for DOS sessions */
  146. USHORT          SessionType;            /* Session type */
  147. USHORT          PgmControl;             /* Session control */
  148. USHORT          FgBg;                   /* Start session in foreground/background */
  149. SHORT           InitXPos;               /* X position */
  150. SHORT           InitYPos;               /* Y position */
  151. SHORT           InitXSize;              /* X size */
  152. SHORT           InitYSize;              /* Y size */
  153. KEYDATA         KeyData;                /* Hotkey data, if none defined, usCh=0, bUsed=0, pMenuData=NULL */
  154. ULONG           SwpFlag;                /* Activation on hotkey SWP flag: SWP_RESTORE or SWP_MAXIMIZE,
  155.                                            SWP_NOMOVE */
  156. USHORT          PriorityClass;          /* Priority Class */
  157. SHORT           PriorityDelta;          /* Priority Delta */
  158. };
  159.  
  160. struct _MENUDATA                        /* Control structure to build popup menu */
  161. {
  162. USHORT          Item;                   /* MENUITEM or SUBMENU */
  163. HWND            hwndItem;               /* Window handle within Popup-Menu */
  164. ULONG           id;                     /* Session ID for menu ressources */
  165. PSZ             PgmTitle;               /* Session title */
  166. PSZ             WindowTitle;            /* Session (sub)title on window's titlebar */
  167. PSZ             PgmName;                /* Session path and filename */
  168. PSZ             PgmDirectory;           /* Session working directory */
  169. PSZ             PgmInputs;              /* Session parameter */
  170. PSZ             PgmDosSettings;         /* Session settings for DOS applications */
  171. USHORT          SessionType;            /* Session type */
  172. USHORT          PgmControl;             /* Session control */
  173. USHORT          FgBg;                   /* Start session in foreground/background */
  174. SHORT           InitXPos;               /* X position */
  175. SHORT           InitYPos;               /* Y position */
  176. SHORT           InitXSize;              /* X size */
  177. SHORT           InitYSize;              /* Y size */
  178. KEYDATA         KeyData;                /* Hotkey data, if none defined, usCh=0, bUsed=0, pMenuData=NULL */ 
  179. ULONG           SwpFlag;                /* Activation on hotkey SWP flag: SWP_RESTORE or SWP_MAXIMIZE,
  180.                                            SWP_NOMOVE */
  181. USHORT          PriorityClass;          /* Priority Class */
  182. SHORT           PriorityDelta;          /* Priority Delta */
  183. MENUDATA        *Back;                  /* Pointer to previous menu */
  184. MENUDATA        *Submenu;               /* Pointer to a submenu */
  185. MENUDATA        *Next;                  /* Pointer to next menu */
  186. };
  187.  
  188. struct  _COMMANDLINEPARAMS
  189. {
  190. UCHAR           ucPgmTitle[MAXNAMEL+1]; /* Session title */
  191. UCHAR           ucPBefore[MAXNAMEL+1];  /* Parameters before user requested parameter */
  192. UCHAR           ucPUser[128];           /* User requested parameter */
  193. UCHAR           ucPAfter[MAXNAMEL+1];   /* Parameters after user requested parameter */
  194. };
  195.  
  196. struct  _HOOKPARAMETERS
  197. {
  198. HAB             habWindow;              /* Anchor block handle of PC/2 */
  199. HWND            hwndWPS;                /* WPS window handle where mouse clicks on WPS
  200.                                            can be found */
  201. HWND            hwndDesktop;            /* PM window handle where mouse clicks on Desktop
  202.                                            can be found */
  203. HWND            hwndPC2;                /* PC/2's window handle to send/post messages to */
  204. ULONG           ProcessId;              /* PC/2's process ID */
  205. USHORT          PriorityClass;          /* PC/2's standard Priority Class */
  206. SHORT           PriorityDelta;          /* PC/2's stantard Priority Delta */
  207.                                         /* Name of Desktop, f.e. OS/2 2.0 Desktop */
  208. UCHAR           ucDesktopName[MAXNAMEL+1];
  209.                                         /* Name of Task List, f.e. Window List */
  210. UCHAR           ucWindowListName[MAXNAMEL+1];
  211. ULONG           ulScrollPercentage;     /* Percentage of physical Desktop used to scroll
  212.                                            through virtual Desktop (25, 50, 75, 100 %) */
  213. ULONG           ulStatusFlag;           /* Bitmapped status flag */
  214. ULONG           ulClickFlag;            /* WM_BUTTON1CLICK for a single click, and
  215.                                            WM_BUTTON1DBLCLK for a double click */
  216. SWP             swpPC2;                 /* Overview window size and position */
  217. SWP             swpPC2Client;           /* Overview window client's size and position */
  218. float           fScaleX, fScaleY;       /* Reduce factor to reduce horizontal size of virtual
  219.                                            Desktop to horizonal client window size */
  220. POINTL          ptlOrigin;              /* Coordinates (0|0) within client area */
  221. POINTL          LLHotBorder;            /* Lower left coordinates that force sliding in x & y direction */
  222. POINTL          URHotBorder;            /* Upper right coordinates that force sliding in -x & -y direction */
  223. POINTL          DesktopSize;            /* Size of the physical Desktop screen */
  224. POINTL          VirtualDesktopPos;      /* Position of the physical Desktop within the virtual */
  225. POINTL          VirtualDesktopMin;      /* Lower left position of whole virtual Desktop */
  226. POINTL          VirtualDesktopMax;      /* Upper right position of whole virtual Desktop */
  227. LONG            SlidingXFactor;         /* Sliding offset in pixel for horizontal movements */
  228. LONG            SlidingYFactor;         /* Sliding offset in pixel for vertical movements */
  229. };
  230.  
  231. struct  _NBPAGE                         /* Notebook pages setup data */
  232. {
  233. PFNWP           pDialogWndProc;         /* Window procedure of a  notebook page */
  234. HWND            hwndPINBPage;           /* Window handle of a notebook page */
  235. ULONG           ulIDPage;               /* ID of notebook page */
  236. PSZ             pszStatusLine;          /* Status line text */
  237. PSZ             pszTab;                 /* Tab text */
  238. ULONG           ulIDDialogPage;         /* ID of a dialog resource */
  239. ULONG           ulIDFocus;              /* ID of control to receive focus */
  240. };
  241.  
  242. struct  _WINDOWDATA                     /* All we need to know about a certain window */
  243. {
  244. UCHAR           ucPgmTitle[MAXNAMEL+1]; /* Session title on titlebar */
  245.                                         /* Session title in Window List */
  246. UCHAR           ucWindowTitle[MAXNAMEL+1];
  247.                                         /* Session's class name */
  248. UCHAR           ucClassName[CLASSNAMESIZE];
  249. SWP             swpWindow;              /* Window's SWP structure */
  250. KEYDATA         KeyData;                /* Hotkey data */
  251. ULONG           SwpFlag;                /* Activation on hotkey SWP flag: SWP_RESTORE or SWP_MAXIMIZE,
  252.                                            SWP_NOMOVE */
  253. HSWITCH         hswitchWindow;          /* Switch handle of the window */
  254. ULONG           ulStatus;               /* Status on overview window */
  255. };
  256.  
  257. struct  _WINDOWS                        /* All windows on PM are traced here */
  258. {
  259. ULONG           ulDesktop;              /* Index of Desktop in WINDOWDATA[] */
  260. ULONG           ulWindowList;           /* Index of Window List in WINDOWDATA[] */
  261. ULONG           ulWindowLast;           /* Index of last window in WINDOWDATA[] */
  262. WINDOWDATA      wdWindow[128];          /* Assume 128 windows maximum */
  263. };
  264.  
  265. #define ID_PC2MAINWINDOW        256
  266. #define ID_PC2THREADWINDOW      257
  267. #define ID_PC2POPUPMENU         258
  268.  
  269. #define PC2_CLASSNAME           "PC2 - Main"
  270. #define PC2_CLASSNAME_THREAD    "PC2 - Thread"
  271.  
  272. #define ID_PC2SETUP             300     /* Defines for PopUp Menu, that is popped up after
  273.                                            the user presses mouse button 1 on DESKTOP */
  274. #define ID_CONFIGDIALOG         301     /* User pressed Configure Menu */
  275. #define ID_ABOUTDIALOG          302     /* User pressed About PC/2 */
  276. #define ID_EXIT                 303     /* User pressed F3 to exit PC/2 */
  277. #define ID_SHUTDOWN             304     /* User pressed ShutDown OS/2 */
  278. #define ID_DESKTOPDIALOG        305     /* User pressed Configure Desktop */
  279. #define ID_HELP                 306     /* ID used for HELP panels */
  280.  
  281. #define ID_ICONEXIT             310     /* Exit PC/2 smarticon */
  282. #define ID_ICONMOVE             311     /* Move smarticon */
  283. #define ID_ICONZORDERTOP        312     /* Set window behind HWND_TOP smarticon */
  284. #define ID_ICONZORDERBOTTOM     313     /* Set window behind HWND_BOTTOM smarticon */
  285. #define ID_ICONCLOSE            314     /* Close window smarticon */
  286. #define ID_ICONMAXIMIZE         315     /* Maximize window smarticon */
  287. #define ID_ICONMINIMIZE         316     /* Minimize window smarticon */
  288. #define ID_ICONRESTORE          317     /* Restore window smarticon */
  289. #define ID_ICONSHUTDOWN         318     /* Shutdown OS/2 smarticon */
  290. #define ID_ICONHELP             319     /* Help PC/2 window smarticon */
  291. #define ID_ICONHIDE             320     /* Hide PC/2 window smarticon */
  292.  
  293. #define ID_MOVEPOINTER          330     /* Pointer active while moving windows on
  294.                                            overview window is enabled */
  295. #define ID_ACTIONPOINTER        331     /* Pointer active while performing actions (except
  296.                                            moving) on windows */
  297.  
  298. #define PIID_PROGRAMDIALOG      500     /* Program installation notebook dialog */
  299. #define PINB_NOTEBOOK           501
  300. #define PIID_PAGE1              502     /* First notebook page */
  301. #define PIGRP_PROGRAM           503     /* Program data group */
  302. #define PIEF_PROGRAMTITLE       504
  303. #define PIEF_PATHFILENAME       505
  304. #define PIEF_DIRECTORY          506
  305. #define PIEF_PARAMETERS         507
  306. #define PIMLE_DOSSETTINGS       508
  307. #define PIPB_WINFILEDLG         509
  308.  
  309. #define PIID_PAGE2              510     /* Second notebook page */
  310. #define PIGRP_TYPE              511     /* Program type group */
  311. #define PIRB_SHELL              512
  312. #define PIRB_OS2FULLSCREEN      513
  313. #define PIRB_OS2WINDOW          514
  314. #define PIRB_PM                 515
  315. #define PIRB_DOSFULLSCREEN      516
  316. #define PIRB_DOSWINDOW          517
  317. #define PIRB_WPSOBJECT          518
  318. #define PIRB_WINOS2             519
  319.  
  320. #define PIGRP_WINOS2            520     /* Seamless WIN-OS2 settings */
  321. #define PIRB_WINREAL            521
  322. #define PIRB_WINSTANDARD        522
  323. #define PIRB_WIN386ENHANCED     523
  324. #define PICB_WINCOMMON          524
  325.  
  326. #define PIID_PAGE3              530     /* Third notebook page */
  327. #define PIGRP_STYLE             531     /* Program style group */
  328. #define PIRB_DEFAULTSTYLE       532
  329. #define PIRB_MAXIMIZED          533
  330. #define PIRB_MINIMIZED          534
  331. #define PIRB_SIZEPOSITION       535
  332. #define PIRB_INVISIBLE          536
  333. #define PIRB_NOAUTOCLOSE        537
  334. #define PIRB_BACKGROUND         538
  335. #define PIGRP_SIZEPOSITION      540     /* User defined size & position */
  336. #define PIEF_X                  541
  337. #define PIEF_Y                  542
  338. #define PIEF_XSIZE              543
  339. #define PIEF_YSIZE              544
  340.  
  341. #define PIID_PAGE4              550     /* Forth notebook page */
  342. #define PIGRP_HOTKEY            551     /* Hotkey settings group */
  343. #define PIEF_SESSIONTITLE       552
  344. #define PICB_HOTKEYENABLED      553
  345. #define PIRB_WSMAXIMIZED        554
  346. #define PIRB_WSRESTORE          555
  347. #define PIRB_NONE               556
  348. #define PIRB_CTRL               557
  349. #define PIRB_ALT                558
  350. #define PICBX_HOTKEY            559
  351. #define PIGRP_DESKTOP           560
  352. #define PICB_DONTMOVE           561
  353. #define PIGRP_WINDOWLIST        562
  354. #define PILB_WINDOWLIST         563
  355.  
  356. #define PIID_PAGE5              570     /* Fifth notebook page */
  357. #define PIGRP_PROCESSPRIORITY   571     /* Process priority */
  358. #define PIRB_IDLETIME           572
  359. #define PIRB_REGULAR            573
  360. #define PIRB_NOCHANGE           574
  361. #define PIRB_TIMECRITICAL       575
  362. #define PIRB_FOREGROUNDSERVER   576
  363. #define PIEF_PRIORITYDELTA      577
  364. #define PIHSB_PRIORITYDELTA     578
  365.  
  366. #define PIID_EXAMPLE1           580
  367. #define PIID_EXAMPLE2           581
  368. #define PIID_EXAMPLE3           582
  369. #define PIID_EXAMPLE4           583
  370. #define PIID_EXAMPLE5           584
  371.  
  372. #define ADID_ABOUTDIALOG        600     /* About program dialog */
  373.  
  374. #define DDID_DESKTOPDIALOG      650     /* Desktop configuration dialog */
  375. #define DDGRP_SLIDINGFOCUS      651
  376. #define DDCB_SLIDINGFOCUS       652
  377. #define DDCB_PRESERVEZORDER     653
  378. #define DDGRP_VIRUTALDESKTOP    660
  379. #define DDCB_BUTTON2ZORDER      661
  380. #define DDCB_VIRTUALDESKTOP     662
  381. #define DDCB_MOVEDESKTOP        663
  382. #define DDCB_CLICK2MOVE         664
  383. #define DDCB_OVERVIEW           665
  384. #define DDCB_KEEPONTOP          666
  385. #define DDEF_DESKTOPNAME        667
  386. #define DDEF_WINDOWLISTNAME     668
  387. #define DDEF_SCROLLPERCENTAGE   669
  388. #define DDHSB_SCROLLPERCENTAGE  670
  389. #define DDGRP_POPUP             675
  390. #define DDRB_BUTTON1CLICK       676
  391. #define DDRB_BUTTON1DBLCLK      677
  392.  
  393. #define CDID_CONFIGDIALOG       700     /* Configuration menu dialog */
  394. #define CDGRP_PROGRAM           701     /* Submenu/Program installation group */
  395. #define CDLB_MENUPROGRAM        702
  396. #define CDID_LEVELUP            703
  397. #define CDID_LEVELDOWN          704
  398. #define CDID_ADDMENU            705
  399. #define CDID_ADDPROGRAM         706
  400. #define CDID_CHANGEENTRY        707
  401. #define CDID_REMOVEENTRY        708
  402. #define CDID_RESORT             709
  403. #define CDID_ADDCONTROL         710
  404.  
  405. #define CDID_HELP_1             711     /* Help pages */
  406. #define CDID_HELP_2             712
  407.  
  408. #define RDID_RESORTDIALOG       750     /* Resort menuentries dialog */
  409. #define RDPB_MOVE               751     /* Move pushbutton */
  410. #define RDGRP_SOURCEMENU        755     /* Move from menu */
  411. #define RDLB_SOURCEMENU         756
  412. #define RDGRP_DESTINATIONMENU   760     /* Move into menu */
  413. #define RDLB_DESTINATIONMENU    761
  414.  
  415. #define MIID_MENUDIALOG         800     /* Menu installation dialog */
  416. #define MIGRP_PROGRAM           801     /* Menu data group */
  417. #define MIEF_MENUTITLE          802
  418.  
  419. #define MIID_HELP_1             810     /* Help page */
  420.  
  421. #define MDID_CONTROLDIALOG      850     /* PC/2 Menu-Control dialog */
  422. #define MDGRP_CTRL              851
  423. #define MDRB_CTRL_CONFIGMENU    852
  424. #define MDRB_CTRL_CONFIGDESKTOP 853
  425. #define MDRB_CTRL_ABOUT         854
  426. #define MDRB_CTRL_SHUTDOWN      855
  427. #define MDRB_CTRL_HELP          856
  428. #define MDRB_CTRL_EXIT          857
  429. #define MDRB_CTRL_BRKSEPARATOR  858
  430. #define MDRB_CTRL_SEPARATOR     859
  431.  
  432. #define SDID_SHUTDOWNDIALOG     900     /* OS/2 ShutDown dialog */
  433. #define SDID_SHUTDOWNMESSAGE    901     /* Message diaplayed a ShutDown */
  434.  
  435. #define SUID_STARTUPDIALOG      950     /* Request parameters from user before launching
  436.                                            an application */
  437. #define SUTF_STARTUPPROGRAM     951     /* Application to be started */
  438. #define SUTF_STARTUPINFO        952     /* Info to the user what to do */
  439. #define SUTF_STARTUPPARAMETERS  953     /* Info to the user of current parameters */
  440. #define SUEF_STARTUPPARAMETERS  954     /* Entryfield for user data */
  441.  
  442. #define ID_POPUPMENU            1500    /* ID used by first user entered entry in the
  443.                                            popup menu. It is incremented by 1 by tracing
  444.                                            through the linked list for each entry (submenu
  445.                                            or menuitem). */
  446. #define USERITEMFIRST           ID_POPUPMENU
  447. #define USERITEMLAST            ID_POPUPMENU+499
  448.  
  449.                                         /* IDs used for HELP panels */
  450. #define MAIN_HELP_TABLE         2001
  451. #define MAIN_HELP_SUBTABLE      2002
  452. #define ID_GENERALHELP          2003
  453. #define ID_CONCEPTSHELP         2004
  454. #define ID_USINGHELP            2005
  455. #define ID_ERRORHELP            2006
  456. #define ID_ERRORHELP_1          2007
  457. #define ID_INSTALLATIONHELP     2008
  458. #define ID_OVERVIEWHELP         2009
  459.                                         /* New messages for the configuration menu dialog */
  460.                                         /* Load the current level into configuration listbox */
  461. #define WM_LOADPOPUPMENU        WM_USER+1
  462.                                         /* Initialize the input queue hook */
  463. #define WM_LOADHOOK             WM_USER+2
  464.                                         /* Save Popup-Menu to Profile */
  465. #define WM_SAVEPOPUPMENU        WM_USER+3
  466.                                         /* Load Popup-Menu from Profile */
  467. #define WM_SETPOPUPMENU         WM_USER+4
  468.                                         /* Display Popup-Menu on Desktop */
  469. #define WM_POPUPMENU            WM_USER+5
  470.  
  471.                                         /* Insert an item to the linked list */
  472. #define MM_INSERTITEMMENUITEM   WM_USER+6
  473.                                         /* Change the first item of a Submenu to an item */
  474. #define MM_INSERTITEMSUBMENU    WM_USER+7
  475.                                         /* Move an item of a Submenu to another position */
  476. #define MM_MOVEMENUITEM         WM_USER+8
  477.                                         /* ShutDown message to ShutDown dialog */
  478. #define WM_SHUTDOWN             WM_USER+9
  479.                                         /* Program Type configuration of Program Installation
  480.                                            dialog */
  481. #define WM_SETUPPROGRAMTYPE     WM_USER+10
  482.                                         /* Program Priority configuration of Program Installation
  483.                                            dialog */
  484. #define WM_SETUPPROGRAMPRIORITY WM_USER+11
  485.                                         /* Program Size & Position configuration of Program
  486.                                            Installation dialog */
  487. #define WM_SETUPSIZEPOSITION    WM_USER+12
  488.                                         /* Hotkey settings to be initialized by Program
  489.                                            Installation dialot */
  490. #define WM_SETUPHOTKEY          WM_USER+13
  491.                                         /* Query and set desktop window handle */
  492. #define WM_SETDESKTOPHANDLE     WM_USER+14
  493.                                         /* Sent by PC2HOOK.DLL if windows need to be moved */
  494. #define WM_DESKTOPMOVE          WM_USER+15
  495.                                         /* Sent by Program Installation dialog to dialog window
  496.                                            procedure to initialize notebook pages with user data */
  497. #define WM_SETUPNOTEBOOKPAGES   WM_USER+16
  498.                                         /* Sent by PC2Hook.DLL when a WM_CHAR message was detected
  499.                                            that is used by the Hotkey function */
  500. #define WM_HOTKEY               WM_USER+17
  501.                                         /* Sent by PC2Hook.DLL when mouse clicks are detected on
  502.                                            PM that would display the window list on the WPS */
  503. #define WM_WINDOWLIST           WM_USER+18
  504.                                         /* This message is sent to the working thread whenever
  505.                                            the overview window needs to be redrawn and any
  506.                                            function thinks so */
  507. #define WM_REPAINT              WM_USER+19
  508.                                         /* The working thread posts itself permanently this
  509.                                            message to repeatedly perform tasks */
  510. #define WM_WORKINGTHREAD        WM_USER+20
  511.                                         /* Sent by PC2Hook.DLL when the pointer is positioned on 
  512.                                            a surrounding row and/or column and the Desktop should
  513.                                            be moved */
  514. #define WM_MOVEREQUEST          WM_USER+21
  515.                                         /* Procedures */
  516. extern int              main(int argc, char *argv[], char *envp[]);
  517. extern BOOL             WinStartUp(HAB *pHab, HMQ *pHmq);
  518. extern BOOL             WinStartHelp(HAB hab, UCHAR *pHelpfile, HWND *pHwndHelp);
  519. extern BOOL             WinCloseDown(HWND *pHwndHelp, HAB *pHab, HMQ *pHmq);
  520. extern void             StartSession(SESSIONDATA *SessionData);
  521. extern BOOL             LoadMenuData2SessionData(MENUDATA *pMenuData, SESSIONDATA *pSessionData);
  522. extern BOOL             LoadSessionData2MenuData(MENUDATA *pMenuData, SESSIONDATA *pSessionData);
  523. extern MENUDATA         *AllocateMenuData(void);
  524. extern void             LoadMenu(MENUDATA *pMenuData);
  525. extern void             SaveMenu(MENUDATA *pMenuData);
  526. extern MRESULT          SetPopupMenu(ULONG msg, MPARAM mp1, MPARAM mp2);
  527. extern MENUDATA         *SearchItem(MENUDATA *pMD, ULONG *id);
  528. extern MENUDATA         *SearchTitle(MENUDATA *pMD, WINDOWDATA *pWD, BOOL *pbFlag);
  529. extern void             InstallFilename2Dialog(HWND hwndDlg, UCHAR *pucFullFileName, BOOL bObject);
  530. extern void             DisableDialogItem(HWND hwndDlg, USHORT usDialogIDs[], USHORT usItemCount, ULONG ulStyle);
  531. extern void             INIAccess(UCHAR *pucFilenameINI, BOOL bRead);
  532. extern void             DrawWindow(HPS hpsClient, SWP *pswpWindow, ULONG ulWindowColor, ULONG ulTextColor, BOOL bWindow, PSZ pszWindowName);
  533. extern void EXPENTRY    PC2DLL_SetParameters(void);
  534. extern BOOL EXPENTRY    PC2DLL_Hook(HAB hab, PQMSG pqmsg, ULONG option);
  535.  
  536.                                         /* PC/2's working thread */
  537. extern void _Optlink    PC2_Thread(void *ThreadArg);
  538.  
  539.                                         /* Window procedures */
  540. extern MRESULT  EXPENTRY PC2_MainWindowProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
  541. extern MRESULT  EXPENTRY PI_DialogProcedure(HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2);
  542. extern MRESULT  EXPENTRY PI_SubclassedDialogProcedure(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
  543. extern MRESULT  EXPENTRY PI_NotebookProcedure(HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2);
  544. extern MRESULT  EXPENTRY AD_DialogProcedure(HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2);
  545. extern MRESULT  EXPENTRY MI_DialogProcedure(HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2);
  546. extern MRESULT  EXPENTRY CD_DialogProcedure(HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2);
  547. extern MRESULT  EXPENTRY SD_DialogProcedure(HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2);
  548. extern MRESULT  EXPENTRY SU_DialogProcedure(HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2);
  549. extern MRESULT  EXPENTRY RD_DialogProcedure(HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2);
  550. extern MRESULT  EXPENTRY DD_DialogProcedure(HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2);
  551. extern MRESULT  EXPENTRY MD_DialogProcedure(HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2);
  552.  
  553.                                         /* Working thread (object) window procedure */
  554. extern MRESULT  EXPENTRY PC2_ThreadWindowProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
  555.  
  556. extern HAB              hab;            /* Handle of PM anchor block */
  557. extern HMQ              hmq;            /* Handle of message queue */
  558. extern HWND             hwndFrame;
  559. extern HWND             hwndClient;
  560. extern HWND             hwndPopupMenu;  /* Handel of popup menu window */
  561. extern HWND             hwndHelp;
  562. extern SESSIONDATA      SessionData;
  563. extern HOOKPARAMETERS   HookParameters; /* Parameters passed to PC2HOOK.DLL */
  564. extern MENUDATA         *pPopupMenu;    /* First entry of linked list of menus */
  565. extern MENUDATA         *pMenuData;     /* First entry of current level of linked list */
  566. extern USHORT           DialogResult;   /* Result of last dialog */
  567. extern USHORT           MenuDataId;     /* Id of the items in the Popup-Menu and linked list */
  568. extern FILE             *Pc2Profile;    /* Profile filename */
  569.                                         /* Path of PC2.INI */
  570. extern UCHAR            *pucFilenameINI;
  571. extern SWP              swpScreen;      /* The screen dimensions */
  572. extern  BOOL            bConfigDialog;  /* TRUE only if the Configuration dialog exists */
  573.                                         /* Hotkeys allowed for PC/2 */
  574. extern KEYDATA          KeyData[KEYDATACOUNT];
  575. extern WINDOWS          Windows;        /* Trace all windows here */
  576.                                         /* Program Installation notebook pages setup */
  577. extern NBPAGE           nbPINotebookPage[];
  578.  
  579. extern HWND             hwndThread;     /* PC/2's working thread window handle */
  580.  
  581.